package com.example.demo.service.impl;

import com.example.demo.mapper.DeptMapper;
import com.example.demo.pojo.emp.Dept;
import com.example.demo.service.DeptService;
import com.example.demo.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {


    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<Dept> list() {
        return deptMapper.list();
    }

    @Override
    public Boolean addDept(Dept dept) {
        dept.setCreateTime(LocalDateTime.now());
        dept.setUpdateTime(LocalDateTime.now());
        Boolean aBoolean = deptMapper.addDept(dept);
        return aBoolean;
    }
}
